bin=httpserver
cgi=test_cgi
cc=g++
LD_FLAFS= -std=c++11 -lpthread 
src=main.cc

all:$(bin) $(cgi)
.PHONY:all 

$(bin):$(src)
	$(cc) -o $@ $^ $(LD_FLAFS) 

$(cgi):cgi/test_cgi.cc
	$(cc) -o $@ $^

.PHONY:clean
clean:
	rm -f $(bin) $(cgi)
	rm -rf output

.PHONY:output 
output:
	mkdir -p output 
	cp $(bin) output 
	cp -rf wwwroot output 
	cp $(cgi) output/wwwroot
